package com.example.gymmanagement.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;
import lombok.Data;

/**
 * 
 * @TableName bill
 */
@TableName(value ="bill")
@Data
public class Bill implements Serializable {
    /**
     * 账单id
     */
    @TableId(value = "bill_id",type=IdType.AUTO)
    private Long billId;

    /**
     * 账单发起者id
     */
    @TableField(value = "bill_user")
    private Long billUser;

    /**
     * 账单类型
     */
    @TableField(value = "bill_type")
    private String billType;

    /**
     * 账单生成时间
     */
    @TableField(value = "bill_time")
    private LocalDateTime billTime;

    /**
     * 账单金额
     */
    @TableField(value = "bill_price")
    private Double billPrice;

    /**
     * 账单详情（租用详情、赔偿详情）
     */
    @TableField(value = "bill_detail")
    private String billDetail;

    /**
     * 账单更改时间
     */
    @TableField(value = "bill_updatetime")
    private LocalDateTime billUpdatetime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Bill other = (Bill) that;
        return (this.getBillId() == null ? other.getBillId() == null : this.getBillId().equals(other.getBillId()))
            && (this.getBillUser() == null ? other.getBillUser() == null : this.getBillUser().equals(other.getBillUser()))
            && (this.getBillType() == null ? other.getBillType() == null : this.getBillType().equals(other.getBillType()))
            && (this.getBillTime() == null ? other.getBillTime() == null : this.getBillTime().equals(other.getBillTime()))
            && (this.getBillPrice() == null ? other.getBillPrice() == null : this.getBillPrice().equals(other.getBillPrice()))
            && (this.getBillDetail() == null ? other.getBillDetail() == null : this.getBillDetail().equals(other.getBillDetail()))
            && (this.getBillUpdatetime() == null ? other.getBillUpdatetime() == null : this.getBillUpdatetime().equals(other.getBillUpdatetime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getBillId() == null) ? 0 : getBillId().hashCode());
        result = prime * result + ((getBillUser() == null) ? 0 : getBillUser().hashCode());
        result = prime * result + ((getBillType() == null) ? 0 : getBillType().hashCode());
        result = prime * result + ((getBillTime() == null) ? 0 : getBillTime().hashCode());
        result = prime * result + ((getBillPrice() == null) ? 0 : getBillPrice().hashCode());
        result = prime * result + ((getBillDetail() == null) ? 0 : getBillDetail().hashCode());
        result = prime * result + ((getBillUpdatetime() == null) ? 0 : getBillUpdatetime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", billId=").append(billId);
        sb.append(", billUser=").append(billUser);
        sb.append(", billType=").append(billType);
        sb.append(", billTime=").append(billTime);
        sb.append(", billPrice=").append(billPrice);
        sb.append(", billDetail=").append(billDetail);
        sb.append(", billUpdatetime=").append(billUpdatetime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }

    public Long getBillId() {
        return billId;
    }

    public Long getBillUser() {
        return billUser;
    }

    public String getBillType() {
        return billType;
    }

    public LocalDateTime getBillTime() {
        return billTime;
    }

    public Double getBillPrice() {
        return billPrice;
    }

    public String getBillDetail() {
        return billDetail;
    }

    public LocalDateTime getBillUpdatetime() {
        return billUpdatetime;
    }
}